<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>奔跑的少年</title>
    <style>/*搜索sprite animation*/
    
        .box1{
            width:79px;
            height:190px;
            /*居中*/
            margin:0 auto;
            /*背景图片*/
            background-image: url("3.jpg");
            animation:run 2s steps(6) infinite;/*2s表示每张动画切换时间为2s  steps(6)几张图片就分几步*/
          
        }
        /*创建关键帧*/
        @keyframes run {
            from{
                background-position: 0 0;
            }
            to{
                background-position: -474px 0;
            }
        }
   </style>
</head>
<body>
    <div class="box1"></div>
</body>
</html>